package com.sctlqq.wuye.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sctlqq.wuye.entity.Result;
import com.sctlqq.wuye.entity.Swiper;
import com.sctlqq.wuye.service.ISwiperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 轮播图Controller（前端控制器）
 */
@RestController
@RequestMapping("/swiper")
public class SwiperController {

    @Autowired//自动实例化
    private ISwiperService swiperService;

    @GetMapping("/findSwiper")
    public Result<Object> findSwiper(){
//        查询所有
//        swiperService.list()
//        条件查询，并排序
//        List<Swiper> swiperList=swiperService.list(new QueryWrapper<Swiper>().eq("open_type","navigate").orderByAsc("id"));
        return new Result<>(HttpStatus.OK.value(),"success",swiperService.list());
    }

}
